<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
		<title>小测试</title>
		<style type="text/css">
			#app {
				background: skyblue;
				height: 100vh;
				padding: 50px;
			}

			.image1_container {
				margin: 0 auto;
				width: 800px;
				height: 450px;
				background: url(img/1.jpg) no-repeat center center/cover;
			}

			.image2_container {
				margin: 0 auto;
				width: 800px;
				height: 450px;
				background: url(img/2.jpg) no-repeat center center/cover;
			}

			.btn_container {
				width: 50%;
				height: 30px;
				margin: 0 auto;
			}

			/* 			.btn_container button{
				margin: 50px;
				width: 100px;
				height: 50px;
			} */
			.health {
				width: 200px;
				height: 30px;
				margin: 0 auto;
				margin-top: 10px;
				border: 1px solid #444;
				text-align: center;
				line-height: 30px;
				font-size: 20px;
				font-weight: 700;
			}
			
			.health_p{
				width: 100%;
				height: 100%;
				background: red;
			}

			.show_elm {
				margin: 50px;
				width: 100px;
				height: 50px;
			}

			.hidden_elm {
				background: #999;
				margin: 50px;
				width: 100px;
				height: 50px;
			}
		</style>
	</head>
	<body>
		<!-- 设计一个程序，疯狂点击按钮，当进度条完了以后就切换另一张图片 -->
		<!-- 有两个按钮，一个是点击，一个是重新开始，当进度条完了以后就只显示重新开始的按钮 -->
		<div id="app">
			<div :class="isEnd?'image2_container':'image1_container'">

			</div>
			<div class="btn_container">
				<div class="health">
					<div class="health_p" :style="{width:health+'%'}"></div>
				</div>
				<button type="button" :class="isEnd?'hidden_elm':'show_elm'" @click="punch">点击</button>
				<button type="button" class="show_elm" @click="restart">重新开始</button>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="app.js">

	</script>
</html>
